import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
const routerHistory = createWebHistory()

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/Home',

    name: '首页',
    meta: {
      title: '首页'
    },
    // component: 'Layout',
    component: () => import('../views/Layout/Layout.vue'),
    children: [
      {
        path: '/test',
        name: 'test',
        meta: {
          title: '首页'
        },
        // component: 'Layout',
        component: () => import('../views/Layout/Content.vue'),
        children: [
          {
            path: '/Home',
            name: 'Home',
            meta: {
              title: '首页'
            },
            // component: 'Layout',
            component: () => import('../views/Home/Home.vue'),
          }
        ]
      }
    ]
  },
  {
    path: '/login',
    name: '登录',
    meta: {
      title: '登录'
    },
    component: () => import('../views/login/login.vue'),
  },
  {
    path: '/404',
    name: '404',
    meta: {
      title: '404'
    },
    component: () => import('../views/404.vue'),
  },
]


const router = createRouter({
  // history: createWebHistory(process.env.BASE_URL),
  history: routerHistory,
  routes: routes
})

export default router
